exports.search = (req,res) => {

    //查询文档信息
    var bodyParams = req.routeInfo.bodyParams;

    var resultData = {};
    
    var sql = "select * from docs where d_id = " + bodyParams.d_id;

    sqliteDb.all(sql,function(err,data){

        if(err){
            return RES.errorResponse(res,"抱歉，文档信息获取失败");
        }

        resultData.apiData = data[0];

        //获取参数信息
        sql = "select * from docs_request_parameter where drp_did = " + bodyParams.d_id;

        sqliteDb.all(sql,function(err,data){

            if(err){
                return RES.errorResponse(res,"抱歉，文档信息获取失败");
            }

            var getParams  = [];
            var postParams = [];

            //区别GET与POST请求参数信息
            for(var i=0;i<data.length;i++){

                if(data[i].drp_way == 'BODY'){
                    postParams.push(data[i]);
                }else{
                    getParams.push(data[i]);
                }

            }

            resultData.getParams  = getParams;
            resultData.postParams = postParams;

            return RES.successResponse(res,resultData);

        });
            
    });

 }